package com.erpanderp.wam.ac.view.project;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Date;
import java.util.HashMap;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.TimeZone;

import javax.faces.application.FacesMessage;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.faces.event.ActionEvent;
import javax.faces.event.AjaxBehaviorEvent;
import javax.servlet.ServletContext;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;

import org.primefaces.component.datatable.DataTable;
import org.primefaces.component.selectonemenu.SelectOneMenu;
import org.primefaces.context.RequestContext;
import org.primefaces.event.RowEditEvent;

import com.erpanderp.wam.ac.model.entity.project.Journey;
import com.erpanderp.wam.ac.model.entity.project.ProjectAssignment;
import com.erpanderp.wam.ac.model.entity.project.ProjectAssignmentDetail;
import com.erpanderp.wam.ac.model.entity.project.VISA;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpense;
import com.erpanderp.wam.ac.model.entity.reimbursement.MiscExpenseDetails;
import com.erpanderp.wam.ac.model.entity.reimbursement.TransportExpense;
import com.erpanderp.wam.ac.model.service.project.JourneyDAO;
import com.erpanderp.wam.ac.model.service.project.ProjectAssignmentDAO;
import com.erpanderp.wam.ac.model.service.project.ProjectAssignmentDetailDAO;
import com.erpanderp.wam.ac.model.service.project.VisaDAO;

import com.erpanderp.wam.adm.model.entity.Resource;
import com.erpanderp.wam.tm.model.entity.RecruitmentProfile;
import com.erpanderp.wam.usm.model.entity.projectandassignment.EmployeeProject;
import com.erpanderp.wam.usm.model.entity.projectandassignment.Project;
import com.erpanderp.wam.usm.model.entity.user.Employee;
import com.erpanderp.wam.usm.model.entity.user.PassportAndPANDetails;
import com.erpanderp.wam.usm.model.entity.user.WAMUser;
import com.erpanderp.wam.usm.model.service.projectandassignment.EmployeeProjectDAO;
import com.erpanderp.wam.usm.model.service.projectandassignment.ProjectDAO;
import com.erpanderp.wam.util.CommonLookup;
import com.erpanderp.wam.util.ValidationUtil;
@ManagedBean
@ViewScoped
public class EditViewInternationalProjectAssignmentBean implements Serializable {

	private static final long serialVersionUID = 1L;
	HttpSession session = (HttpSession) FacesContext.getCurrentInstance().getExternalContext().getSession(true);
	HttpServletRequest request = (HttpServletRequest) FacesContext.getCurrentInstance().getExternalContext().getRequest();
	ServletContext context = (ServletContext) FacesContext.getCurrentInstance().getExternalContext().getContext();
	
	String projectAssignmentId = request.getParameter("projectAssignmentId");
    String employeeId = request.getParameter("employeeId");
	
    ProjectDAO projectDAO = new ProjectDAO();
	ProjectAssignmentDAO projectAssignmentDAO = new ProjectAssignmentDAO();
	ProjectAssignmentDetailDAO projectAssignmentDetailDAO = new ProjectAssignmentDetailDAO();
	JourneyDAO journeyDAO = new JourneyDAO();
	VisaDAO visaDAO = new VisaDAO();
	JourneyDAO onwardJourneyDAO = new JourneyDAO();
	JourneyDAO returnJourneyDAO = new JourneyDAO();
	
	private EmployeeProject  employeeProject = new EmployeeProject();
	EmployeeProjectDAO employeeProjectDAO = new EmployeeProjectDAO();
	
	private List<EmployeeProject> employeeProjects = new ArrayList<EmployeeProject>();
	private ProjectAssignment projectAssignment = new ProjectAssignment();
	private ProjectAssignmentDetail projectAssignmentDetail = new ProjectAssignmentDetail();
	private Journey onwardJourney = new Journey();
	private Journey returnJourney = new Journey();
	private VISA visa = new VISA();
	private List<Journey> editableOnwardJourneyDetails;
	private List<Journey> editableReturndJourneyDetails;
	private ProjectAssignment editableOnwardJourney;
	private ProjectAssignment editableReturndJourney;

	private Employee employee = new Employee();
	private Project selectedProject= new Project();
	private WAMUser wamUser = (WAMUser) session.getAttribute(CommonLookup.SESSION_ATTRIBUTE_WAMUSER);
	private Employee reportingManager;
	
	private boolean SHOW_EDIT_DIALOG=false;
	private boolean FORM_VALID;
	private boolean renderApproveReject;
	private boolean renderUpdate;
	private boolean renderDisableUpdate;
	private boolean renderClose;
	private boolean renderProjectsAssignmentsList;
	private boolean renderProjectsAssignments;
	
	private List<ProjectAssignment> projectAssignmentsList = new ArrayList<ProjectAssignment>();
	private List<ProjectAssignmentDetail> projectAssignmentDetailList = new ArrayList<ProjectAssignmentDetail>();
	private List<PassportAndPANDetails> passportAndPANDetailsList = new ArrayList<PassportAndPANDetails>();
	private List<Journey> onwardJourneyDetails = new ArrayList<Journey>();
	private List<Journey> returnJourneyDetails = new ArrayList<Journey>();
	private List<Journey> onwardJournies = new ArrayList<Journey>();
	private List<Journey> returnJournies = new ArrayList<Journey>();
	private List<Journey> availableOnwardJourneyDetails = new ArrayList<Journey>();
	private List<Journey> availableReturnJourneyDetails = new ArrayList<Journey>();
	private List<Project> projects = new ArrayList<Project>();
	
	private Set<Journey> onwardJourneyDetailsSet = new HashSet<Journey>();
	private Set<Journey> returnJourneyDetailsSet = new HashSet<Journey>();
	
	
	
	Map<String, Long> projectsMap = new HashMap<String, Long>();
    
	private DataTable availableOnwordJourneyDetailsTable;
	private DataTable availableReturnJourneyDetailsTable;
	
    private Long selectedProjectId;
	private String projectAssignmentCode;
	private String contactNumber="";
	private String passportNumber;
	private String approvedBy="";
	private Float advanceAmount;
	private Float roomRentAdvance;
	private Date createDate;
	private String additionals;
	private TimeZone defaultTimeZone = TimeZone.getDefault();
	public EditViewInternationalProjectAssignmentBean() 
	{
		// TODO Auto-generated constructor stub
		System.out.println("constructor start.................EditViewInternationalProjectAssignmentBean");
		setWamUser((WAMUser) session.getAttribute(CommonLookup.SESSION_ATTRIBUTE_WAMUSER));
		projectAssignmentCode=CommonLookup.getAutoGeneratedInternationalProjectAssignmentCode(wamUser.getEmployee().getEmployeeCode());
		System.out.println("InternationalProjectAssignmentId.........."+projectAssignmentCode);
		setCreateDate(new Date());
		employee.setFirstName(wamUser.getEmployee().getFirstName());
		employee.setLastName(wamUser.getEmployee().getLastName());
		setEmployeeId(wamUser.getEmployee().getEmployeeCode());
		//wamUser.getEmployee().getNewJoinee().getPassportAndPANDetails();
		setPassportNumber("AD45567H890");
//		passportAndPANDetailsList.addAll(wamUser.getEmployee().getNewJoinee().getPassportAndPANDetails());
//		for(PassportAndPANDetails passportAndPANDetails : passportAndPANDetailsList){
//			setPassportNumber(passportAndPANDetails.getPassportNumber());
//			System.out.println("passportAndPANDetails.getPassportNumber()............"+passportAndPANDetails.getPassportNumber());
//		}
		setContactNumber(wamUser.getEmployee().getTelephone());
		setApprovedBy(CommonLookup.PROJECTASSIGNMENT_DOMESTIC_INTERNATIONAL_APPROVER);
		projects = projectDAO.getAllProjects();
		
		 employeeProjects = employeeProjectDAO.getAllEmployeeProjects(wamUser.getEmployee().getEmployeeId());
		  for(EmployeeProject employeeProject :employeeProjects)
		  {
			  projectsMap.put(employeeProject.getProject().getProjectName(), employeeProject.getProject().getProjectId());
		  }
		System.out.println("MAP: " + projectsMap);
		projectAssignment = projectAssignmentDAO.getProjectAssignmentByProjectAssignmentId(Long.parseLong(projectAssignmentId));
		onwardJourneyDetails = journeyDAO.getOnwardJourneyDetailsByProjectAssignmentIdJourneyType(projectAssignment.getProjectAssignmentId(), CommonLookup.JOURNEY_TYPE_ONWARD);
		System.out.println("availableOnwardJourneyDetails size: " + onwardJourneyDetails.size());
		returnJourneyDetails = journeyDAO.getReturnJourneyDetailsByProjectAssignmentIdJourneyType(projectAssignment.getProjectAssignmentId(), CommonLookup.JOURNEY_TYPE_RETURN);
		System.out.println("availableReturndJourneyDetails size: " + returnJourneyDetails.size());
		//projectAssignment.getVisaDetails().add(visa);
		
		List<VISA> tempList = new ArrayList<VISA>();
		tempList.addAll(projectAssignment.getVisaDetails());
		visa = tempList.get(0);
		if(projectAssignment.getApprovalStatus().equals("APPROVED") || projectAssignment.getRecommendationStatus().equals("RECOMMENDED"))
		{
		System.out.println("1111111111111111");
		setRenderUpdate(false);
		setRenderDisableUpdate(true);
		FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, projectAssignment.getProjectAssignmentId() + " ProjectAssignment is sent for Approval!", ""));
		}
		else
		{
		System.out.println("22222222222222");
		setRenderUpdate(true);		
		setRenderDisableUpdate(false);
		//FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, projectAssignment.getProjectAssignmentId() + " ProjectAssignment is Inprocess!", ""));
		}
		

	}
	


	public void projectChangeListener(AjaxBehaviorEvent e) {
		selectedProjectId = Long.parseLong(((SelectOneMenu)e.getComponent()).getValue().toString());
		System.out.println(selectedProjectId);
		projectAssignment.setProject(projectDAO.getProjectByProjectID(selectedProjectId));
     }
	
	public String reinitOnward() {  
	    
		 System.out.println("In reinitOnward.....");
		 
		 //projectAssignment = new ProjectAssignment();
		 validateFormOnward();
			if(FORM_VALID){
		onwardJourney.setModifiedBy(wamUser.getEmployee().getFirstName() +" "+ wamUser.getEmployee().getLastName());
		onwardJourney.setDateModified(new Date());
		onwardJourney.setJourneyType(CommonLookup.JOURNEY_TYPE_ONWARD);
		onwardJourney.setStatus(CommonLookup.STATUS_ACTIVE);
		onwardJourney.setProjectAssignment(projectAssignment);
		projectAssignment.getOnwardJourneyDetails().add(onwardJourney);
		onwardJourney = new Journey();
		 //
			}
		 return null;  
		 }
	//VALIDATION FOR ONWARD JOURNEY
			private void validateFormOnward()
			{
				System.out.println("validateForm.....................");
				FORM_VALID = true;

				System.out.println("onwardJourney.getModeOfTravel()....................."+onwardJourney.getModeOfTravel());

				if(onwardJourney.getModeOfTravel().equals("Choose One"))
			{
					FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Choose Mode of travel for onward journey ", ""));
				FORM_VALID = false;
			}
			if(ValidationUtil.isEmpty(String.valueOf(onwardJourney.getNameOfCarrier()), "Name of carrier for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(String.valueOf(onwardJourney.getCarrierId()), "CarrierId for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(String.valueOf(onwardJourney.getSource()), "From for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(String.valueOf(onwardJourney.getDestination()), "To for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(onwardJourney.getDepartureDate() != null ? onwardJourney.getDepartureDate().toString() :null , "Departure date for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(onwardJourney.getArrivalDate() != null ? onwardJourney.getArrivalDate().toString() :null , "Arrival date for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(onwardJourney.getDepartureTime() != null ? onwardJourney.getDepartureTime().toString() :null , "Departure time for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}

			if(ValidationUtil.isEmpty(onwardJourney.getArrivalTime() != null ? onwardJourney.getArrivalTime().toString() :null , "Arrival time for onward journey ", null, FacesContext.getCurrentInstance()) != null){
				FORM_VALID = false;
			}
			if(onwardJourney.getDepartureDate() != null && onwardJourney.getArrivalDate() != null )
			{
				if(onwardJourney.getDepartureDate().compareTo(onwardJourney.getArrivalDate())>0){	
					System.out.println("FROMDATE is after TODATE");
					FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN," Departure Date should not be more than Arrival Date in onward journey", ""));
					FORM_VALID = false;
				}
			}
					

			}

	
	public void removeFromOnwardJourneyList(ActionEvent e){
		Journey onwardJourney  = (Journey) availableOnwordJourneyDetailsTable.getRowData();		
		onwardJourneyDetails.remove(onwardJourney);
		onwardJourneyDAO.deleteSelectedOnwardJourney(onwardJourney);
	}
	
  public String reinitReturn() {  
	   
	    
		System.out.println("In reinitReturn.....");
		//projectAssignment = new ProjectAssignment();
		validateFormReturn();
		if(FORM_VALID){
		returnJourney.setModifiedBy(wamUser.getEmployee().getFirstName() +" "+ wamUser.getEmployee().getLastName());
		returnJourney.setDateModified(new Date());
		returnJourney.setJourneyType(CommonLookup.JOURNEY_TYPE_RETURN);
		returnJourney.setStatus(CommonLookup.STATUS_ACTIVE);
		returnJourney.setProjectAssignment(projectAssignment);
		projectAssignment.getReturnJourneyDetails().add(returnJourney);
		returnJourney = new Journey();
		}
		return null;  
	} 
  
  private void validateFormReturn()
	{
		System.out.println("validateForm.....................");
		FORM_VALID = true;
		if(returnJourney.getModeOfTravel().equals("Choose One"))
		{
				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, "Choose Mode of travel for return journey ", ""));
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(String.valueOf(returnJourney.getNameOfCarrier()), "Name of carrier for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(String.valueOf(returnJourney.getCarrierId()), "CarrierId for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(String.valueOf(returnJourney.getSource()), "From for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(String.valueOf(returnJourney.getDestination()), "To for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(returnJourney.getDepartureDate() != null ? returnJourney.getDepartureDate().toString() :null , "Departure date for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(returnJourney.getArrivalDate() != null ? returnJourney.getArrivalDate().toString() :null , "Arrival date for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(returnJourney.getDepartureTime() != null ? returnJourney.getDepartureTime().toString() :null , "Departure time for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		
		if(ValidationUtil.isEmpty(returnJourney.getArrivalTime() != null ? returnJourney.getArrivalTime().toString() :null , "Arrival time for return journey ", null, FacesContext.getCurrentInstance()) != null){
			FORM_VALID = false;
		}
		if(returnJourney.getDepartureDate() != null && returnJourney.getArrivalDate() != null )
		{
		if(returnJourney.getDepartureDate().compareTo(returnJourney.getArrivalDate())>0){
			
  		System.out.println("FROMDATE is after TODATE");
  		FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN," Departure Date should not be more than Arrival Date in return journey", ""));
  		FORM_VALID = false;
  	}
		}
		
		
	}

	public void removeFromReturnJourneyList(ActionEvent e)		
	{
		Journey returnJourney = (Journey) availableReturnJourneyDetailsTable.getRowData();		
		returnJourneyDetails.remove(returnJourney);
		returnJourneyDAO.deleteSelectedReturnJourney(returnJourney);
	}
	

	  
	public String updateInternationalProjectAssignment() 
	{
		System.out.println("In  updateInternationalProjectAssignment");
	    validateForm();
		if(FORM_VALID){
			
			projectAssignment.setApprovalStatus(CommonLookup.PROJECT_ASSIGNMENT_INPROCESS_STATUS);
			projectAssignment.setRecommendationStatus(CommonLookup.PROJECT_ASSIGNMENT_INPROCESS_STATUS);
			projectAssignment.setStatus(CommonLookup.STATUS_ACTIVE);
			projectAssignment.setModifiedBy(wamUser.getEmployee().getFirstName() +" "+ wamUser.getEmployee().getLastName());
			projectAssignment.setDateModified(new Date());
			
			visa.setModifiedBy(wamUser.getEmployee().getFirstName() +" "+ wamUser.getEmployee().getLastName());
			visa.setDateModified(new Date());
			visa.setStatus(CommonLookup.STATUS_ACTIVE);
			
			if(projectAssignmentDAO.updateInternationalProjectAssignment(projectAssignment) != null ){
 			System.out.println("In update success....");
			FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_INFO, projectAssignment.getProjectAssignmentId() + " ProjectAssignment updated successfully.", ""));
			System.out.println("In update success....after");
			projectAssignment = new ProjectAssignment();
			projectAssignment.setProject(new Project());
			}else{
 				FacesContext.getCurrentInstance().addMessage(null, new FacesMessage(FacesMessage.SEVERITY_WARN, "Failed to update ProjectAssignment.", ""));
 			}
			RequestContext.getCurrentInstance().execute("EditProjectAssignmentDialog.hide();");
						
			}
		else
		{
			RequestContext.getCurrentInstance().execute("EditProjectAssignmentDialog.show();");			
		}
		return null;
	}
	
	//VALIDATION
			private void validateForm(){
				System.out.println("validateForm.....................");
				FORM_VALID = true;
				
				System.out.println("projectAssignment.getEmergencycontactNumber()....................."+projectAssignment.getEmergencycontactNumber());
				
				if(ValidationUtil.isEmpty(projectAssignment.getEmergencycontactNumber(), "Emergency Contact Number ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
//				if(ValidationUtil.isEmpty(selectedProjectId.toString() , "Project", "", FacesContext.getCurrentInstance()) != null || ValidationUtil.isNonZero(selectedProjectId, "Project ", "", FacesContext.getCurrentInstance()) != null)
//				{
//					System.out.println("selectedProjectId.toString()...111111111........"+selectedProjectId.toString());
//				FORM_VALID = false;
//				}

				if(ValidationUtil.isEmpty(String.valueOf(visa.getVISANumber()), "Visa number ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(visa.getValidUpto() != null ? visa.getValidUpto().toString() :null , "ValidUpto in visa details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getType()), "Visa type in visa details ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getCountry()), "Country in visa details ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getInsuranceProvider()), "Insurance provider in insurance details ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getInsurancePolicyNumber()), "Insurance policy number in insurance details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(visa.getValidFrom() != null ? visa.getValidFrom().toString() :null , "Valid From in insurance details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(visa.getValidTo() != null ? visa.getValidTo().toString() :null , "Valid To in insurance details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getWCCNumber()), "WCC number in project assignment allowance details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				System.out.println("visa.getDailyAllowance()........."+visa.getDailyAllowance());
//				if(Long.valueOf(visa.getDailyAllowance()) = 0.0)
//				{
//					System.out.println("selectedProjectId.toString()...111111111........"+selectedProjectId.toString());
//				FORM_VALID = false;
//				}
				if(ValidationUtil.isEmpty(String.valueOf(visa.getPayCycle()), "Payment Cycle in project assignment allowance details  ", null, FacesContext.getCurrentInstance()) != null){
					FORM_VALID = false;
				}
				if(visa.getValidFrom() != null && visa.getValidTo() != null )
				{
				if(visa.getValidFrom().compareTo(visa.getValidTo())>0){
					
		    		System.out.println("FROMDATE is after TODATE");
		    		FacesContext.getCurrentInstance().addMessage(null,new FacesMessage(FacesMessage.SEVERITY_WARN," Valid From should not be more than Valid To in insurance details", ""));
		    		FORM_VALID = false;
		    	}
				}
				System.out.println("Finally FORM_VALID is :::::"+FORM_VALID);
			}
			public void dialogClose(){	
				System.out.println("dialogClose .................");
				RequestContext.getCurrentInstance().execute("EditProjectAssignmentDialog.hide()");		
				}
	
	//GETTERS AND SETTERS
	public HttpServletRequest getRequest() {
		return request;
	}

	public void setRequest(HttpServletRequest request) {
		this.request = request;
	}

	public HttpSession getSession() {
		return session;
	}

	public void setSession(HttpSession session) {
		this.session = session;
	}

	public ProjectDAO getProjectDAO() {
		return projectDAO;
	}

	public void setProjectDAO(ProjectDAO projectDAO) {
		this.projectDAO = projectDAO;
	}

	public ProjectAssignmentDAO getProjectAssignmentDAO() {
		return projectAssignmentDAO;
	}

	public void setProjectAssignmentDAO(ProjectAssignmentDAO projectAssignmentDAO) {
		this.projectAssignmentDAO = projectAssignmentDAO;
	}

	public ProjectAssignmentDetailDAO getProjectAssignmentDetailDAO() {
		return projectAssignmentDetailDAO;
	}

	public void setProjectAssignmentDetailDAO(
			ProjectAssignmentDetailDAO projectAssignmentDetailDAO) {
		this.projectAssignmentDetailDAO = projectAssignmentDetailDAO;
	}

	public ProjectAssignment getProjectAssignment() {
		return projectAssignment;
	}

	public void setProjectAssignment(ProjectAssignment projectAssignment) {
		this.projectAssignment = projectAssignment;
	}

	public ProjectAssignmentDetail getProjectAssignmentDetail() {
		return projectAssignmentDetail;
	}

	public void setProjectAssignmentDetail(
			ProjectAssignmentDetail projectAssignmentDetail) {
		this.projectAssignmentDetail = projectAssignmentDetail;
	}

	public Employee getEmployee() {
		return employee;
	}

	public void setEmployee(Employee employee) {
		this.employee = employee;
	}

	public Project getSelectedProject() {
		return selectedProject;
	}

	public void setSelectedProject(Project selectedProject) {
		this.selectedProject = selectedProject;
	}

	public WAMUser getWamUser() {
		return wamUser;
	}

	public void setWamUser(WAMUser wamUser) {
		this.wamUser = wamUser;
	}

	public Employee getReportingManager() {
		return reportingManager;
	}

	public void setReportingManager(Employee reportingManager) {
		this.reportingManager = reportingManager;
	}

	public boolean isSHOW_EDIT_DIALOG() {
		return SHOW_EDIT_DIALOG;
	}

	public void setSHOW_EDIT_DIALOG(boolean sHOW_EDIT_DIALOG) {
		SHOW_EDIT_DIALOG = sHOW_EDIT_DIALOG;
	}

	public boolean isFORM_VALID() {
		return FORM_VALID;
	}

	public void setFORM_VALID(boolean fORM_VALID) {
		FORM_VALID = fORM_VALID;
	}

	public boolean isRenderApproveReject() {
		return renderApproveReject;
	}

	public void setRenderApproveReject(boolean renderApproveReject) {
		this.renderApproveReject = renderApproveReject;
	}

	public boolean isRenderUpdate() {
		return renderUpdate;
	}

	public void setRenderUpdate(boolean renderUpdate) {
		this.renderUpdate = renderUpdate;
	}

	public boolean isRenderClose() {
		return renderClose;
	}

	public void setRenderClose(boolean renderClose) {
		this.renderClose = renderClose;
	}

	public boolean isRenderProjectsAssignmentsList() {
		return renderProjectsAssignmentsList;
	}

	public void setRenderProjectsAssignmentsList(
			boolean renderProjectsAssignmentsList) {
		this.renderProjectsAssignmentsList = renderProjectsAssignmentsList;
	}

	public boolean isRenderProjectsAssignments() {
		return renderProjectsAssignments;
	}

	public void setRenderProjectsAssignments(boolean renderProjectsAssignments) {
		this.renderProjectsAssignments = renderProjectsAssignments;
	}

	public List<ProjectAssignment> getProjectAssignmentsList() {
		return projectAssignmentsList;
	}

	public void setProjectAssignmentsList(
			List<ProjectAssignment> projectAssignmentsList) {
		this.projectAssignmentsList = projectAssignmentsList;
	}

	public List<ProjectAssignmentDetail> getProjectAssignmentDetailList() {
		return projectAssignmentDetailList;
	}

	public void setProjectAssignmentDetailList(
			List<ProjectAssignmentDetail> projectAssignmentDetailList) {
		this.projectAssignmentDetailList = projectAssignmentDetailList;
	}

	public List<PassportAndPANDetails> getPassportAndPANDetailsList() {
		return passportAndPANDetailsList;
	}

	public void setPassportAndPANDetailsList(
			List<PassportAndPANDetails> passportAndPANDetailsList) {
		this.passportAndPANDetailsList = passportAndPANDetailsList;
	}

	public List<Project> getProjects() {
		return projects;
	}

	public void setProjects(List<Project> projects) {
		this.projects = projects;
	}

	public Map<String, Long> getProjectsMap() {
		return projectsMap;
	}

	public void setProjectsMap(Map<String, Long> projectsMap) {
		this.projectsMap = projectsMap;
	}

	public String getProjectAssignmentId() {
		return projectAssignmentId;
	}

	public void setProjectAssignmentId(String projectAssignmentId) {
		this.projectAssignmentId = projectAssignmentId;
	}

	public Long getSelectedProjectId() {
		return selectedProjectId;
	}

	public void setSelectedProjectId(Long selectedProjectId) {
		this.selectedProjectId = selectedProjectId;
	}

	public String getProjectAssignmentCode() {
		return projectAssignmentCode;
	}

	public void setProjectAssignmentCode(String projectAssignmentCode) {
		this.projectAssignmentCode = projectAssignmentCode;
	}

	public String getEmployeeId() {
		return employeeId;
	}

	public void setEmployeeId(String employeeId) {
		this.employeeId = employeeId;
	}

	public String getContactNumber() {
		return contactNumber;
	}

	public void setContactNumber(String contactNumber) {
		this.contactNumber = contactNumber;
	}

	public String getPassportNumber() {
		return passportNumber;
	}

	public void setPassportNumber(String passportNumber) {
		this.passportNumber = passportNumber;
	}

	public String getApprovedBy() {
		return approvedBy;
	}

	public void setApprovedBy(String approvedBy) {
		this.approvedBy = approvedBy;
	}

	public Float getAdvanceAmount() {
		return advanceAmount;
	}

	public void setAdvanceAmount(Float advanceAmount) {
		this.advanceAmount = advanceAmount;
	}

	public Float getRoomRentAdvance() {
		return roomRentAdvance;
	}

	public void setRoomRentAdvance(Float roomRentAdvance) {
		this.roomRentAdvance = roomRentAdvance;
	}

	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getAdditionals() {
		return additionals;
	}

	public void setAdditionals(String additionals) {
		this.additionals = additionals;
	}

	public static long getSerialversionuid() {
		return serialVersionUID;
	}

	public Journey getOnwardJourney() {
		return onwardJourney;
	}
	public void setOnwardJourney(Journey onwardJourney) {
		this.onwardJourney = onwardJourney;
	}
	public Journey getReturnJourney() {
		return returnJourney;
	}
	public void setReturnJourney(Journey returnJourney) {
		this.returnJourney = returnJourney;
	}
	public VISA getVisa() {
		return visa;
	}
	public void setVisa(VISA visa) {
		this.visa = visa;
	}
	public List<Journey> getOnwardJourneyDetails() {
		return onwardJourneyDetails;
	}
	public void setOnwardJourneyDetails(List<Journey> onwardJourneyDetails) {
		this.onwardJourneyDetails = onwardJourneyDetails;
	}
	public List<Journey> getReturnJourneyDetails() {
		return returnJourneyDetails;
	}
	public void setReturnJourneyDetails(List<Journey> returnJourneyDetails) {
		this.returnJourneyDetails = returnJourneyDetails;
	}
	public List<Journey> getOnwardJournies() {
		return onwardJournies;
	}
	public void setOnwardJournies(List<Journey> onwardJournies) {
		this.onwardJournies = onwardJournies;
	}
	public List<Journey> getReturnJournies() {
		return returnJournies;
	}
	public void setReturnJournies(List<Journey> returnJournies) {
		this.returnJournies = returnJournies;
	}
	public JourneyDAO getJourneyDAO() {
		return journeyDAO;
	}
	public void setJourneyDAO(JourneyDAO journeyDAO) {
		this.journeyDAO = journeyDAO;
	}
	public Set<Journey> getOnwardJourneyDetailsSet() {
		return onwardJourneyDetailsSet;
	}
	public void setOnwardJourneyDetailsSet(Set<Journey> onwardJourneyDetailsSet) {
		this.onwardJourneyDetailsSet = onwardJourneyDetailsSet;
	}
	public Set<Journey> getReturnJourneyDetailsSet() {
		return returnJourneyDetailsSet;
	}
	public void setReturnJourneyDetailsSet(Set<Journey> returnJourneyDetailsSet) {
		this.returnJourneyDetailsSet = returnJourneyDetailsSet;
	}

	public DataTable getAvailableOnwordJourneyDetailsTable() {
		return availableOnwordJourneyDetailsTable;
	}
	public void setAvailableOnwordJourneyDetailsTable(
			DataTable availableOnwordJourneyDetailsTable) {
		this.availableOnwordJourneyDetailsTable = availableOnwordJourneyDetailsTable;
	}
	
	public List<Journey> getAvailableOnwardJourneyDetails() {
		return availableOnwardJourneyDetails;
	}
	public void setAvailableOnwardJourneyDetails(
			List<Journey> availableOnwardJourneyDetails) {
		this.availableOnwardJourneyDetails = availableOnwardJourneyDetails;
	}
	public List<Journey> getAvailableReturnJourneyDetails() {
		return availableReturnJourneyDetails;
	}
	public void setAvailableReturnJourneyDetails(
			List<Journey> availableReturnJourneyDetails) {
		this.availableReturnJourneyDetails = availableReturnJourneyDetails;
	}
	public DataTable getAvailableReturnJourneyDetailsTable() {
		return availableReturnJourneyDetailsTable;
	}
	public void setAvailableReturnJourneyDetailsTable(
			DataTable availableReturnJourneyDetailsTable) {
		this.availableReturnJourneyDetailsTable = availableReturnJourneyDetailsTable;
	}
	public ServletContext getContext() {
		return context;
	}

	public void setContext(ServletContext context) {
		this.context = context;
	}

	public VisaDAO getVisaDAO() {
		return visaDAO;
	}

	public void setVisaDAO(VisaDAO visaDAO) {
		this.visaDAO = visaDAO;
	}
	public JourneyDAO getOnwardJourneyDAO() {
		return onwardJourneyDAO;
	}



	public void setOnwardJourneyDAO(JourneyDAO onwardJourneyDAO) {
		this.onwardJourneyDAO = onwardJourneyDAO;
	}



	public JourneyDAO getReturnJourneyDAO() {
		return returnJourneyDAO;
	}



	public void setReturnJourneyDAO(JourneyDAO returnJourneyDAO) {
		this.returnJourneyDAO = returnJourneyDAO;
	}



	


	public ProjectAssignment getEditableOnwardJourney() {
		return editableOnwardJourney;
	}



	public void setEditableOnwardJourney(ProjectAssignment editableOnwardJourney) {
		this.editableOnwardJourney = editableOnwardJourney;
	}



	public ProjectAssignment getEditableReturndJourney() {
		return editableReturndJourney;
	}



	public void setEditableReturndJourney(ProjectAssignment editableReturndJourney) {
		this.editableReturndJourney = editableReturndJourney;
	}



	public TimeZone getDefaultTimeZone() {
		return defaultTimeZone;
	}



	public void setDefaultTimeZone(TimeZone defaultTimeZone) {
		this.defaultTimeZone = defaultTimeZone;
	}



	public List<Journey> getEditableReturndJourneyDetails() {
		return editableReturndJourneyDetails;
	}



	public void setEditableReturndJourneyDetails(
			List<Journey> editableReturndJourneyDetails) {
		this.editableReturndJourneyDetails = editableReturndJourneyDetails;
	}



	public List<Journey> getEditableOnwardJourneyDetails() {
		return editableOnwardJourneyDetails;
	}



	public void setEditableOnwardJourneyDetails(
			List<Journey> editableOnwardJourneyDetails) {
		this.editableOnwardJourneyDetails = editableOnwardJourneyDetails;
	}



	public boolean isRenderDisableUpdate() {
		return renderDisableUpdate;
	}



	public void setRenderDisableUpdate(boolean renderDisableUpdate) {
		this.renderDisableUpdate = renderDisableUpdate;
	}
	public EmployeeProject getEmployeeProject() {
		return employeeProject;
	}



	public void setEmployeeProject(EmployeeProject employeeProject) {
		this.employeeProject = employeeProject;
	}



	public EmployeeProjectDAO getEmployeeProjectDAO() {
		return employeeProjectDAO;
	}



	public void setEmployeeProjectDAO(EmployeeProjectDAO employeeProjectDAO) {
		this.employeeProjectDAO = employeeProjectDAO;
	}



	public List<EmployeeProject> getEmployeeProjects() {
		return employeeProjects;
	}



	public void setEmployeeProjects(List<EmployeeProject> employeeProjects) {
		this.employeeProjects = employeeProjects;
	}



}
